﻿/*------------------------------------------------
// File Description: Product DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-03-09 16:31:21
//------------------------------------------------*/

using System.Data.Entity;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 存货表
    /// </summary>
    [Table(nameof(Product))]
    public class Product : BaseEntity
    {
        private string _productCode = string.Empty;
        private string _productName = string.Empty;
        private string _specifications = string.Empty;
        private string _categoryCode = string.Empty;
        private string _categoryName = string.Empty;
        private string _mainUnitCode = string.Empty;
        private string _mainUnitName = string.Empty;
        private string _productionOrigin = string.Empty;

        #region Public Property

        ///<Summary>
        /// 存货编码
        ///</Summary>
        public string ProductCode
        {
            get { return string.IsNullOrWhiteSpace(_productCode) ? string.Empty : _productCode; }
            set { _productCode = value; }
        }

        ///<Summary>
        /// 存货名称
        ///</Summary>
        public string ProductName
        {
            get { return string.IsNullOrWhiteSpace(_productName) ? string.Empty : _productName; }
            set { _productName = value; }
        }

        ///<Summary>
        /// 规格型号
        ///</Summary>
        public string Specifications
        {
            get { return string.IsNullOrWhiteSpace(_specifications) ? string.Empty : _specifications; }
            set { _specifications = value; }
        }

        ///<Summary>
        /// 大类编码
        ///</Summary>
        public string CategoryCode
        {
            get { return string.IsNullOrWhiteSpace(_categoryCode) ? string.Empty : _categoryCode; }
            set { _categoryCode = value; }
        }

        ///<Summary>
        /// 大类名称
        ///</Summary>
        public string CategoryName
        {
            get { return string.IsNullOrWhiteSpace(_categoryName) ? string.Empty : _categoryName; }
            set { _categoryName = value; }
        }

        ///<Summary>
        /// 主计量单位编码
        ///</Summary>
        public string MainUnitCode
        {
            get { return string.IsNullOrWhiteSpace(_mainUnitCode) ? string.Empty : _mainUnitCode; }
            set { _mainUnitCode = value; }
        }

        ///<Summary>
        /// 主计量单位名称
        ///</Summary>
        public string MainUnitName
        {
            get { return string.IsNullOrWhiteSpace(_mainUnitName) ? string.Empty : _mainUnitName; }
            set { _mainUnitName = value; }
        }

        ///<Summary>
        /// 产地产牌
        ///</Summary>
        public string ProductionOrigin
        {
            get { return string.IsNullOrWhiteSpace(_productionOrigin) ? string.Empty : _productionOrigin; }
            set { _productionOrigin = value; }
        }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 存货表
        /// </summary>
        public virtual DbSet<Product> Products { get; set; }
    }
}